<?php
$pagetitle="Server Info";
include('header.php');

include('loaddb.php');

include('functions.inc.php');

$result=$mysql->query("select hostname,INET_NTOA(ip) as ip,numsharedfiles,totalsize from hosts,host_stats,int_settings where hosts.id=host_stats.hostid and int_settings.name='curscan' and int_settings.value=host_stats.scanid order by totalsize");

showCrumbs('servers');

print "<table>\n";

print "<table>\n";
print " <tr>\n";
print "  <td>Hostname</td>\n";
print "  <td>IP Address</td>\n";
print "  <td># of shared files</td>\n";
print "  <td>Shared Data</td>\n";
print " </tr>\n";
while ($myrow=$result->fetch_array())
{
	$totalsize=size_readable($myrow['totalsize']);
	$sharedfiles=number_format($myrow['numsharedfiles']);
	print " <tr>\n";
	print "  <td>$myrow[hostname]</td>\n";
	print "  <td>$myrow[ip]</td>\n";
	print "  <td style=\"text-align:right\">$sharedfiles</td>\n";
	print "  <td style=\"text-align:right\">$totalsize</td>\n";
	print " </tr>\n";
}

print "</table>\n";

?>
<div id="graphlinks">
<a href="servergraph.php">Nacho Sexy Graph</a><br />
<a href="sexygraph.svg">Sexy Graph - SVG Version</a> Only works in Firefox<br />
<a href="sexygraph.swf">Sexy Graph - Flash Version</a>
</div>

<?php
include("footer.php");
hitPageCounter($mysql,"servers");
